<%@ Page Language="C#" MasterPageFile="~/Admin.master" AutoEventWireup="true" CodeFile="ViewAccount.aspx.cs" Inherits="Pages_Admin_ViewAccounts" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <asp:Label ID="Label1" runat="server" Font-Bold="True" Text="View Accounts" CssClass="header"></asp:Label><br />
    <br />
    <br />
    <asp:Panel ID="Panel1" runat="server" Height="34px" Width="620px">
        Search Account:
        <asp:TextBox ID="txtSearch" runat="server"></asp:TextBox>&nbsp;&nbsp;<asp:Button ID="btnSearch"
            runat="server" Text="Search" OnClick="btnSearch_Click" />
        <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSearch"
            ErrorMessage="Please enter text to search"></asp:RequiredFieldValidator><br />
        &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&nbsp;
        <asp:RadioButton ID="rdFullName" runat="server" Checked="True" GroupName="GroupSearch"
            Text="FullName" />&nbsp;
        <asp:RadioButton ID="rdBranchName" runat="server" GroupName="GroupSearch" Text="BranchName" /></asp:Panel>
    <br />
    &nbsp; &nbsp; &nbsp;&nbsp;
    <asp:Label ID="lblMessage" runat="server" ForeColor="Red"></asp:Label><br />
    <br />
    <asp:GridView ID="gvAccounts" runat="server" AutoGenerateColumns="False" HeaderStyle-CssClass="smallheader" HeaderStyle-BackColor="#a9c0f2" BorderColor="#556CB0" GridLines="Vertical" Width="560px" AllowPaging="True" DataKeyNames="UserName" OnPageIndexChanging="gvAccounts_PageIndexChanging" DataSourceID="AccountObjectDataSource" >
        <HeaderStyle HorizontalAlign="Center" BackColor="#A9C0F2" CssClass="smallheader" />
        <AlternatingRowStyle BackColor="Gainsboro" />
        <Columns>
            <asp:BoundField DataField="UserName" HeaderText="UserName" ReadOnly="True" SortExpression="UserName" />
            <asp:BoundField DataField="FullName" HeaderText="FullName" SortExpression="FullName" />
            <asp:BoundField DataField="Address" HeaderText="Address" SortExpression="Address" />
            <asp:BoundField DataField="Email" HeaderText="Email" SortExpression="Email" />
            <asp:BoundField DataField="PhoneNumber" HeaderText="PhoneNumber" SortExpression="PhoneNumber" />
            <asp:BoundField DataField="BranchName" HeaderText="BranchName" SortExpression="BranchName" />
            <asp:CheckBoxField DataField="IsWorking" HeaderText="IsWorking" SortExpression="IsWorking" />
            <asp:HyperLinkField DataNavigateUrlFields="UserName" DataNavigateUrlFormatString="~/Pages_Admin/ManageAccounts/EditAccount.aspx?UserName={0}"
                HeaderText="Edit" Text="Edit" />
            <asp:TemplateField HeaderText="Delete">
                <ItemTemplate>
                    <asp:CheckBox ID="cboDelete" runat="server" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <RowStyle HorizontalAlign="Center" />
    </asp:GridView>
    <br />
    <asp:Button ID="btnAddAccount" runat="server" Text="Add new account" OnClick="btAddAccount_Click" CausesValidation="False" />
    &nbsp;
    <asp:Button ID="btnDeleteAccount" runat="server" Text="Delete selected accounts" CausesValidation="False" OnClick="btnDeleteAccount_Click" OnClientClick='return confirm("Are you sure you want to delete selected accounts?");' />
    <asp:ObjectDataSource ID="AccountObjectDataSource" runat="server" SelectMethod="GetAllAccounts"
        TypeName="DALAccount"></asp:ObjectDataSource>
</asp:Content>

